#ifndef GATE_CONNECTOR_MGR_H
#define GATE_CONNECTOR_MGR_H

#include <map>
#include <singleton.h>
#include <gate_module.h>

/**
    This class is in the responsible of all the gate connectors
*/
class CGateConnectorMgr : public CSingleton<CGateConnectorMgr>
{
    friend class CSingleton<CGateConnectorMgr>;
public:
    // add gate connector
    void AddConnector(uint32 nRemoteIP, utility::network::gate_connector * conn);
    void AddConnector(const char * szRemoteIP, utility::network::gate_connector * conn);

    // remove one connector from the list
    void RemoveConnector(uint32);

    // Find corresponding gate connector
    utility::network::gate_connector * Get(uint32 nRemoteIP);
private:
    typedef std::map<uint32, utility::network::gate_connector*> TGateConnectorContainer;
    TGateConnectorContainer m_GateConnectors;
    
};

#endif
